<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<script>
			// 1. 利用 new Object() 创建对象
			let obj1 = new Object();

			// 2. 利用 对象字面量 创建对象（常用）
			let obj2 = {};

			// 3. 利用 构造函数 创建对象
			function Star(uname, age) {
				this.uname = uname;
				this.age = age;
				this.sing = function () {
					console.log('vae');
				};
			}

			let xs = new Star('vae', 35);
			let dkh = new Star('darkgreen', 19);
			console.log(xs);
			xs.sing();
			console.log(dkh);
			dkh.sing();
		</script>
	</body>
</html>
